package com.soft.javase.day09.personremoverepeat;

import java.util.HashSet;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/4/29
 */
public class RemoveRepeat {
    public static void main(String[] args) {
        HashSet<Person> personSet = new HashSet<>();

        Person[] personArray = {new Person("张三", 18),
                new Person("李四", 20),
                new Person("张三", 18),
                new Person("李四", 22),
                new Person("王五", 18)};

        for (Person person : personArray) {
            personSet.add(person);
        }

        System.out.println(personSet);

    }
}
